import React from 'react'
import RankItemEchart from 'components/rank-item-echart'
/**
 * 名称：排名图
 * 描述：排名图 包含标签排名图和活动排名图
 * 调用：营销效果中心
 * 输入：store 营销数据
 * 时间：20220404
 */
class RankDisplayEchart extends React.Component {
 
render() {
    const {store} = this.props
    const {activityRankData,tagRankData} = store
    let activityRankSortData = activityRankData && activityRankData.sort(function (a, b) {
        return b.joinNum - a.joinNum;
    })
    let tagRankSortData = tagRankData && tagRankData.sort(function (a, b) {
        return b.joinNum - a.joinNum;
    })
    const activityStore = {
        data:activityRankSortData,
        id:"activity-rank",
        titleLabel:"活动排名" }
    const tagStore = {
        data:tagRankSortData,
        id:"tag-rank",
        titleLabel:"标签排名" }
    return (
        <div style={{height:'100%'}}>
            <div style={{ width: '100%',height:'50%' }}>
                <RankItemEchart store = {activityStore} />
            </div>
            <div style={{ width: '100%',height:'50%' }}>
                <RankItemEchart store = {tagStore} />
            </div>
        </div>
    );
}
}

export default RankDisplayEchart